package com.snap.vseries.bean;

import android.util.SparseArray;

import java.io.Serializable;

import io.protostuff.Tag;

/**
 * 孔位信息
 */
public class HoleInfo implements Serializable {
    private static int FAM_ENABLE = 0x00000001;
    private static int VIC_ENABLE = 0x00000002;
    private static int ROX_ENABLE = 0x00000004;
    private static int CY5_ENABLE = 0x00000008;
    /**
     * 通道参与实验的flag
     * 最低位就是第1通道(对应fam） 次低位就是第2通道(对应vic) 以此类推 1代表参与 0代表没参与
     */
    @Tag(1)
    private int channelJoinFlag = 0;
    /**
     * 处理后的分析数据
     */
    @Tag(2)
    private SparseArray<ChannelBean> channelData;

    public SparseArray<ChannelBean> getChannelData() {
        return channelData;
    }

    public void setChannelData(SparseArray<ChannelBean> channelData) {
        this.channelData = channelData;
    }

    public int getChannelJoinFlag() {
        return channelJoinFlag;
    }

    public void setChannelJoinFlag(int channelJoinFlag) {
        this.channelJoinFlag = channelJoinFlag;
    }

    public boolean isFamEnable() {
        return (channelJoinFlag & FAM_ENABLE) == FAM_ENABLE;
    }

    public void setFamEnable(boolean enable) {
        if (enable) {
            channelJoinFlag |= FAM_ENABLE;
        } else {
            channelJoinFlag &= ~FAM_ENABLE;
        }
    }

    public boolean isVicEnable() {
        return (channelJoinFlag & VIC_ENABLE) == VIC_ENABLE;
    }

    public void setVicEnable(boolean enable) {
        if (enable) {
            channelJoinFlag |= VIC_ENABLE;
        } else {
            channelJoinFlag &= ~VIC_ENABLE;
        }
    }

    public boolean isRoxEnable() {
        return (channelJoinFlag & ROX_ENABLE) == ROX_ENABLE;
    }

    public void setRoxEnable(boolean enable) {
        if (enable) {
            channelJoinFlag |= ROX_ENABLE;
        } else {
            channelJoinFlag &= ~ROX_ENABLE;
        }
    }

    public boolean isCy5Enable() {
        return (channelJoinFlag & CY5_ENABLE) == CY5_ENABLE;
    }

    public void setCy5Enable(boolean enable) {
        if (enable) {
            channelJoinFlag |= CY5_ENABLE;
        } else {
            channelJoinFlag &= ~CY5_ENABLE;
        }
    }


}
